label cafe_scene:
    
    show bg_cafe
    with dissolve
    
    e "Welcome to the cafe! The date is Y[calendar.current_year], [calendar.current_month]/[calendar.current_date]"
    
    npc_crow "KAAH, UI UNDER CONSTRUCTION. ACTIVATE PLACEHOLDER MENU."
    
    #QQQQ
    $ calendar_event = 0
    $ astrid_event = -1
    $ blanche_event = -1
    $ kyra_event = -1
    $ zeno_event = -1
    $ ean_event = -1
    $ levi_event = -1
    
    #QQQQ
    python:
        astrid_stats.activity = SERVE
        blanche_stats.activity = COOK
        kyra_stats.activity = SERVE
        zeno_stats.activity = REST
        ean_stats.activity = REST
        levi_stats.activity = COOK
    
    $ days_to_work = 1
    
    #1. INSERT STORYLINE MORNING EVENT CHECKER HERE. Turns the flag up if event is detected
    python:
        calendar_event = calendar.has_day_event()
        print "EVENT FOUND: " + str(calendar_event)
            
    if(calendar_event < 0): #if quest number is negative, do it before going into the cafe controls
        jump main_event_picker
    
label cafescene_am_done: #You'll come back here if the cafe event is a morning, AND it's NOT whole day

label back_to_cafe_main:

    call screen gui_cafe_main
    
    #QQQQ
    #python:
    #    watcher              = MockFileWatcher()
    #    watcher.fileChanged += log_file_change2
    #    watcher.fileChanged += log_file_change
    #    watcher.fileChanged -= log_file_change2
    #    watcher.watchFiles()
        
    #TODO: INSERT PROCESSING OF COMPUTATION HERE!
    # PSEUDOCODE
    # 1-2. IF EVENT EXISTS, MAKE IT HAPPEN BEFORE WORKING. STORYLINE EVENT FIRST, THEN RELATIONSHIP.
    # LABEL CONTINUE DAY HERE (HAPPENS AFTER AN EVENT)
    # 3. INVOLVE PROGRESS OF ALL THE MAIDS AND BUTLERS AND YOU. AT THE SAME TIME, RAISE THEIR STATS AND STRESS
    # 4. PROFIT (OR LOSS)
    
label start_day:
    
    e "START DAY!"
    
    #1. INSERT STORYLINE EVENT CHECKER HERE. Turns the flag up if event is detected
    python:
        calendar_event = calendar.has_day_event()
        print "EVENT FOUND: " + str(calendar_event)
            
    if(calendar_event < 0):
        jump main_event_picker
    
    #2. INSERT RELATIONSHIP EVENT CHECKER HERE.
    python:
        astrid_event = astrid_stats.event_check()
        blanche_event = blanche_stats.event_check()
        kyra_event = kyra_stats.event_check()
        zeno_event = zeno_stats.event_check()
        ean_event = ean_stats.event_check()
        levi_event = levi_stats.event_check()
        if astrid_event > -1:
            print "OY! May event si Astrid!"
        else:
            print "Walang event si Astrid..."
        
    if astrid_event > -1:
        jump astrid_quest_picker
    elif blanche_event > -1:
        jump blanche_quest_picker
    elif kyra_event > -1:
        jump kyra_quest_picker
    elif zeno_event > -1:
        jump zeno_quest_picker
    elif ean_event > -1:
        jump ean_quest_picker
    elif levi_event > -1:
        jump levi_quest_picker
    
    #3. PROCESS WORKDAY
    jump process_workday
    
label workday_complete:
    
    #TODO: Show the WorkDay Results screen here!
    e "Phew, that was tiring!"
    
    #4. CHECK FOR AFTER WORK EVENTS (noted by positive number event)
    if(calendar_event > 0):
        jump main_event_picker

label characterscene_done:
label cafescene_pm_done:

    #5. Advance day, and move on
    
    scene black with dissolve
    #TODO: Show Transition Day Screen here!
    python:
        calendar.advance_day()
    
    
    
    jump cafe_scene
    
    
#    screen hello_world:
#        tag example
#        zorder 1
#        modal False
#        text "Hello, World."
#    screen test_frame:
#        frame:
#            xpadding 10
#            ypadding 10
#            xalign 0.5
#            yalign 0.5

#            vbox:
#                text "Display"
#                null height 10
#                textbutton "Fullscreen" action Preference("display", "fullscreen")
#                textbutton "Window" action Preference("display", "window")
    
#    show screen hud_day
    
#    e "Tada"
    
#    call screen example_imagemap
#    $ result = _return
   
#    if result == "swim":
#        e "You picked swimming!"
#    elif result == "science":
#        e "You picked science!"
#    elif result == "art":
#        e "You picked art!"
#    elif result == "go home":
#        e "You went home!"
    
#    e "TADA"